package com.jinzhu.controller;

import com.jinzhu.pojo.PageResult;
import com.jinzhu.pojo.Result;
import com.jinzhu.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LogController {

    @Autowired
    private EmpService empService;

    /**
     * 分页查询
     */
    @GetMapping("/log")
    public Result Page(String name,
                       @RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "10") Integer pageSize) {

        PageResult pageResult = empService.logPage(page, pageSize,name);
        return Result.success(pageResult);
    }

}
